import Vue from "vue";
import App from "./App";
import store from "./store";
import * as tools from "@/utils/tools";
import * as regexp from "@/utils/regexp";
import * as type from "@/utils/type";
import * as auth from "@/utils/auth";
import * as page from "@/utils/page";
import api from "@/api/index.js";
// #ifdef APP-PLUS
import device from '@/utils/device.js';
// #endif

// 将vuex挂载到 `$store`
Vue.prototype.$store = store;

// 将全局公共方法扩展到 `Vue` 上，方便调用。通过 `$vm.$$tools` 或者 `$vm.$$t` 调用
// 区别内部属性或方法，区分来源。
Vue.prototype.$$t = Vue.prototype.$$tools = { 
  ...tools, 
  ...regexp, 
  ...type, 
  ...auth,
};

// 页面方法
Vue.prototype.$$p = Vue.prototype.$$page = page;

// 接口方法
Vue.prototype.$$a = Vue.prototype.$$api = api;

// #ifdef APP-PLUS
// 设备信息
Vue.prototype.$$d = Vue.prototype.$$device = device;
// #endif

// 生产模式无提示
Vue.config.productionTip = false;

App.mpType = "app";

const app = new Vue({
  store,
  ...App,
});
app.$mount();
